// .txt

beginzonescript;

variables;

short im_hostile = 0;
short last_abil;
short counter = 0;
short set_ter1 = 0;
short did_alert = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

	set_name(6200,"Nilzichek");
	set_name(6210,"Nilzichek's Hound");
	set_name(30002,"Dhagan Brigand");


	set_attack_range(30001,4);

//	add_ability(short which_char_or_group,short which_slot,short which_ability,0);

//	if (is_town_clear(ME))
//		clean_up_town();

	sf(62,20,1);
	sf(62,21,0);
	sf(62,25,0);
	
	if ((gf(62,10) > 0) || (has_spec_item(10))) {
		erase_char(30002);
		erase_char(6218);

		erase_char(30003);
		}
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	//if ((set_ter1 == 0) && (gf(0,0) > 0)) {
	//	set_ter1 = 1;
	//	set_terrain(,,,);
	//	}

	if ((gf(62,14) == 0) && (gf(62,23) > 0) && (gf(62,15) == 0)) {
		sf(62,15,1);
		erase_char(30002);
		erase_char(6218);
		activate_hidden_group(1);
		}
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6200,"Welcome to the ruins.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6200,"I buy and sell.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6200,"I trade, he hunts.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6200,"Need Ezequiel back.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6200,"Only quality goods here.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6218,"We are trapped too.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6218,"The shades appeared.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6218,"Always been safe before.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6218,"We can work together.");


	//if (gf(,) < 2) {
	//	inc_flag(,,1);
	//	if (gf(,) == 2)
	//		begin_talk_mode();
	//	}

	//if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_town()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
	//	last_abil = get_current_tick();
	//	if ((gf(,) > 0) && (gf(,) < 100))
	//	}
break;

beginstate 10;
	if ((char_ok(6238)) && (get_attitude(6238) < 10)) {
		set_attitude(6238,10);
		set_attitude(6239,10);
		set_attitude(6240,10);
		set_attitude(6241,10);
		}
break;

beginstate 11;
	if (did_alert == 0) {
		did_alert = 1;
		alert_char(6244);
		}
break;

beginstate 12;
break;

beginstate 13;
break;

//	print_str("");
//	set_terrain_string_range(".",1);
//	set_terrain_string_range("The sign says - .",1);
